from selenium import webdriver
from selenium.webdriver.common.by import By

import time

from selenium.webdriver.common.keys import Keys

driver = webdriver.Chrome()

driver.get("https://so.gushiwen.cn/user/login.aspx")


driver.find_element_by_id("email").send_keys("18515088415")

driver.find_element_by_id("pwd").send_keys("123456")

time.sleep(8)

driver.find_element_by_id("denglu").click()

search_ele = driver.find_element_by_id("txtKey")
search_ele.send_keys("江雪")

time.sleep(2)

search_ele.send_keys(Keys.ENTER)


driver.find_element(By.XPATH, "//div[@class='shoucang']/img").click()

time.sleep(2)

driver.find_element(By.XPATH, "//div[@class='son1']/a[6]").click()



time.sleep(2)

driver.find_element(By.XPATH, "//div[@class='sons']/div[1]/a").click()


# driver.get_screenshot_as_file("test.png")
# x = 0
# for i in range(1, 4):
#     driver.get_screenshot_as_file("img/test{}.png". format(i))
#     print("拍照结束")
#     driver.execute_script("window.scrollTo(0, {})".format(i * 200))